package edu.zut.pioneer.commodity.domain;


import edu.zut.pioneer.base.domain.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Table;

@Entity
@Table(name="commodity")

public class Commodity extends BaseEntity<Long> {

    private static final long serialVersionUID = 7308677292852312663L;

    @Column(name="name")
    private String name;
    @Column(name="price")
    private double price;
    @Column(name="info")
    private String info;
    @JoinColumn(name = "commodity_sort_id")
    @Column(name="commodity_sort_id")
    private long type;

    public Commodity(){}

    public Commodity( String name,double price, String info,long type) {

        this.name = name;
        this.price = price;
        this.info = info;
        this.type = type;
    }

    @Override
    public String toString() {
        return "Commodity{"+"name='" + name + "price="+price+"info="+info+'\'' + ", type='" + type +'}';
    }


    public void setCommodity_sort_id(int i) {
    }

    public String getName() {
        return name;
    }

    public double getPrice() {
        return price;
    }

    public String getInfo() {
        return info;
    }

    public long getType_id() {
        return type;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public void setType_id(long type_id) {
        this.type = type_id;
    }
}
